trigger LeadProcessTest on Lead (before insert, before update, after insert, after update){

    if (trigger.isBefore && trigger.isInsert)
    {
        //FlagDuplicateLead.findDuplicates(trigger.new);
        LeadTriggersClass.UpdateProjectDetails(trigger.new);
    }
    
    if (trigger.isBefore && trigger.isUpdate)
    {
        LeadTriggersClass.RestrictChangeOwnership(trigger.new);
    }
    
    if (trigger.isAfter && trigger.isInsert)
    {
        //LeadTriggersClass.InsertUpdateReferral(trigger.new, trigger.newMap);
        set<id> leadIdSet = new Set<Id>();
        for(Lead l:trigger.new){
            leadIdSet.add(l.Id);
        }
        FlagDuplicateLead.findDuplicateLeads(leadIdSet);      
    }
    
    if (trigger.isAfter && trigger.isUpdate)
    {
        //LeadTriggersClass.InsertUpdateReferral(trigger.new, trigger.newMap);
        if(!(trigger.new.size() > 1))
        {
            LeadTriggersClass.CallAttemptToOppOnConversion(trigger.new);
        }
    }

}